import request from './request'

/**
 * 获取字典目录列表
 * @param {*} params
 * @returns
 */
export const getDictionaryList = (params) => {
  return request({
    url: '/dictionary/list',
    params
  })
}

/**
 * 新增字典目录
 * @param {*} data
 * @returns
 */
export const addDictionary = (data) => {
  return request({
    url: '/dictionary/add',
    method: 'post',
    data
  })
}

/**
 * 修改字典目录
 * @param {*} data
 * @returns
 */
export const updateDictionary = (data) => {
  return request({
    url: '/dictionary/update',
    method: 'put',
    data
  })
}

/**
 * 根据Id删除字典目录
 * @param {*} id
 */
export const deleteDictionary = (id) => {
  return request({
    url: `/dictionary/${id}`,
    method: 'delete'
  })
}

/**
 * 获取字典数据列表
 * @param {*} params
 * @returns
 */
export const getDictionaryDataList = (params) => {
  return request({
    url: '/dictionary_data/list',
    params
  })
}

/**
 * 新增字典目录
 * @param {*} data
 * @returns
 */
export const addDictionaryData = (data) => {
  return request({
    url: '/dictionary_data/add',
    method: 'post',
    data
  })
}

/**
 * 修改字典目录
 * @param {*} data
 * @returns
 */
export const updateDictionaryData = (data) => {
  return request({
    url: '/dictionary_data/update',
    method: 'put',
    data
  })
}

/**
 * 根据Id删除字典目录
 * @param {*} id
 */
export const deleteDictionaryData = (id) => {
  return request({
    url: `/dictionary_data/${id}`,
    method: 'delete'
  })
}
